﻿<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
    <!--_meta 作为公共模版分离出去-->
    <% layout("/common/_meta.html",{title:"角色管理"}){} %>
    <!--_meta 作为公共模版分离出去-->
    <%
    var isAddBtn = satoken.hasPermission("role:add");
    var isUpdateBtn = satoken.hasPermission("role:update");
    var isDeleteBtn = satoken.hasPermission("role:delete");
    %>
</head>
<body>
<div class="wap-container">
    <nav class="breadcrumb" style="background-color:#fff;padding: 0 24px">首页<span class="c-gray en">/</span>用户管理<span class="c-gray en">/</span>角色管理<a class="btn btn-success radius f-r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
    <article class="Hui-admin-content clearfix">
        <div class="panel mt-20">
            <div class="panel-body">
                <div class="clearfix">
                    <span class="f-l">
                        <%if(isAddBtn){%>
                        <button onclick="layer_show('添加角色','${ctxPath}/role/addForm')" class="btn btn-primary radius" type="button"><i class="Hui-iconfont">&#xe600;</i> 添加角色</button>
                        <%}%>
                    </span>
                    <span class="f-r">
                        <span class="r">共有数据：<strong>${roles.~size}</strong> 条</span>
                    </span>
                </div>
                <div class="mt-20 clearfix">
                    <table class="table table-border table-bordered table-bg table-hover table-striped">
                        <thead>
                        <tr class="text-c">
                            <th>ID</th>
                            <th>名称</th>
                            <th>描述</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <%for(role in roles){%>
                        <tr class="text-c">
                            <td>${role.id}</td>
                            <td>${role.name}</td>
                            <td>${role.description}</td>
                            <td>
                                <%if(isUpdateBtn){%>
                                <button onclick="layer_show('修改角色','${ctxPath}/role/updateForm?id=${role.id}')" class="btn btn-secondary-outline size-MINI radius" type="button">修改</button>
                                <%}%>
                                <%if(isDeleteBtn){%>
                                <button onclick="layer_confirm('确认删除角色？','${ctxPath}/role/delete?id=${role.id}')" class="btn btn-danger-outline size-MINI radius" type="button">删除</button>
                                <%}%>
                            </td>
                        </tr>
                        <%}%>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </article>
</div>

<!--_footer 作为公共模版分离出去-->
<% layout("/common/_footer.html"){} %>
<!--/_footer 作为公共模版分离出去-->
<script type="text/javascript">
    $(function () {
        // 操作提示
        var code = $("#code").val();
        var msg = $("#msg").val();
        if (msg.length > 0) {
            layer_msg(code, msg);
        }
    });
</script>
</body>
</html>
